import { Game } from "../../game/Game";
import { GameConn } from "../../game/player/GameConn";
import { Conn } from "./Conn";

/**
 * 本地连接
 */
export class LocalConn extends GameConn {

    constructor(game: Game) {
        super();
        game.onConn(this);
    }

    send<ID extends keyof KProtoToc>(protoId: ID, data: KProtoToc[ID]): void;
    send<ID extends Exclude<KProtoId, keyof KProtoToc>>(protoId: ID): void;
    send(protoId: KProtoId, data?: any): void {
        Conn.onProto(protoId, data);
    }

}